<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vue2中数组变化的限制&解决方法</title>
    <style>
      #app {
        text-align: center;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <h1>Vue2中数组变化的限制&解决方法</h1>
      {{ colors }}
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.min.js"></script>
    <script>
      let vm = new Vue({
        el: '#app',
        data() {
          return {
            colors: ['red', 'green', 'blue']
          };
        },
      });

      vm.colors.splice(2);
    </script>
  </body>
</html>
